package shared.pojo

import shared.pojo.Pojo.ResultData
import upickle.default._

/** Created by yz on 7/11/2022
  */
object Predict {

  case class PredictData(
      sampleId: String = "12345",
      name: String = "绘云",
      age: String = "30",
      ast: String = "100",
      alt: String = "200",
      plt: String = "100",
      tyr: String = "60",
      tca: String = "5",
      phe: String = "30",
      trp: String = "100",
      valine: String = "200",
      ca: String = "100",
      met: String = "60",
      gca: String = "5",
      gcdca: String = "200",
      tcdca: String = "100",
      userId: Int = 0
  )

  object PredictData {

    implicit val rw = macroRW[PredictData]

  }

  object Predict {

    case class Response(missionId: Int = 0, valid: Boolean = true, message: String = "")

    object Response {

      implicit val rw = macroRW[Response]

    }

  }

  object PredictResult {

    case class Request(missionId: Int = 0, userId: Int)

    object Request {

      implicit val rw = macroRW[Request]

    }

    case class ExtraDataRow(
        id: Int = 0,
        userId: Int = 0,
        sampleId: String = "",
        unit: String = "",
        address: String = "",
        name: String = "",
        sex: String = "",
        office: String = "",
        doctor: String = "",
        number: String = "",
        sampleTime: String = "",
        submitTime: String = "",
        sampleType: String = "",
        sampleStatus: String = "",
        title: String = "",
        danger: String = "",
        reporter: String = "",
        checker: String = "",
        checkDate: String = "",
        reportDate: String = "",
        testMethod: String = ""
    )
    object ExtraDataRow {
      implicit val rw = macroRW[ExtraDataRow]
    }
    case class MissionRow(
        id: Int = 0,
        userId: Int = 0,
        age: String = "",
        ast: String = "",
        alt: String = "",
        plt: String = "",
        tyr: String = "",
        tca: String = "",
        phe: String = "",
        trp: String = "",
        valine: String = "",
        ca: String = "",
        met: String = "",
        gca: String = "",
        gcdca: String = "",
        tcdca: String = "",
        score: String = "",
        result: String = "",
        endTime: String = ""
    )

    object MissionRow {
      implicit val rw = macroRW[MissionRow]
    }

    case class Response(
        extra: ExtraDataRow = ExtraDataRow(),
        mission: MissionRow = MissionRow(),
        result: ResultData = ResultData()
    )

    object Response {

      implicit val rw = macroRW[Response]

    }

  }

  object Export {

    case class Request(
        id: Int = 0,
        userId: Int = 0,
        title: String = "",
        unit: String = "",
        address: String = "",
        sex: String = "",
        name: String = "",
        age: String = "",
        office: String = "",
        doctor: String = "",
        number: String = "",
        sampleTime: String = "",
        submitTime: String = "",
        sampleId: String = "",
        sampleType: String = "",
        sampleStatus: String = "",
        reporter: String = "",
        checker: String = "",
        checkDate: String = "",
        reportDate: String = "",
        testMethod: String = "",
        ast: String = "",
        alt: String = "",
        plt: String = "",
        tca: String = "",
        tyr: String = "",
        phe: String = "",
        trp: String = "",
        valine: String = "",
        ca: String = "",
        met: String = "",
        gca: String = "",
        gcdca: String = "",
        tcdca: String = "",
        score: String = "",
        result: String = "",
        endTime: String = "",
        danger: String = "",
        caseDouble: BigDecimal = 0,
        cirrhosis: BigDecimal = 0,
        lateFibrosis: BigDecimal = 0,
        svgStr: String = "",
    )

    object Request {

      implicit val rw = macroRW[Request]

    }

  }

}
